﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StockIn_Purchase.ascx.cs" Inherits="Controls_Activity_StockIn_Purchase" %>
 <%@ Register Src="SelectGood.ascx" TagName="GoodItemSelect" TagPrefix="uc1" %>
 <asp:Panel ID="pnlItemsGrid" runat="server" CssClass="centerPanel" Width="100%">
 <div class="webPanelBorder" >
        <div class="webPanelCaption">入库单信息</div>
        <div class="webPanelContent">
             <table cellspacing="1" class="table">
                <tr>
                    <td class="tableSubjectWidth">入库日期：
                    </td>
                    <td><asp:TextBox ID="P_StockInDate" onfocus="calendar.ShowCaltable(this, event);" runat="server" CssClass="shortInput" MaxLength="64" ></asp:TextBox>
                        <ofcc:RequiredField ID="RequiredField1" runat="server" />
                    </td>
                     <td class="tableSubjectWidth">入库类型：
                    </td>
                    <td><asp:TextBox ID="TextBox1" runat="server" CssClass="shortInput" MaxLength="64" Text="采购入库" ReadOnly="true"></asp:TextBox>
                    </td>
                </tr>
                <tr> 
                    <td>供 应 商：
                    </td>
                    <td><asp:TextBox ID="P_SupplierID" runat="server" CssClass="shortInput" MaxLength="64" ></asp:TextBox>
                    </td>
                    <td>备    注：</td>
                    <td><asp:TextBox ID="P_Description" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>经 办 人：</td>
                    <td><asp:TextBox ReadOnly="true" ID="P_LoginName" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                    <td>经办部门：</td>
                    <td><asp:TextBox ReadOnly="true" ID="P_Department" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                </tr>  
                </table>               
        </div>  
    </div>
    
 <div class="webPanelBorder" > 
    <div class="webPanelCaption">具体物料项</div>
    <div class="webPanelContent">
      <ofcc:GridView ID="gridViewItems" runat="server" AutoGenerateColumns="False" 
        OnRowDataBound="gridViewItems_RowDataBound" onrowdeleting="gridViewItems_RowDeleting" OnRowEditing="gridViewItems_RowEditing" >
            <Columns>
                <asp:HyperLinkField DataTextField="GoodsCode" HeaderText="物料编号" NavigateUrl="#" Target="_blank" />
                <asp:BoundField DataField="Subject" HeaderText="物料名称" />
                <asp:BoundField DataField="CategoryName" HeaderText="物料类型" />
                <asp:BoundField DataField="GoodsMaker" HeaderText="品牌厂商" />
                <asp:BoundField DataField="TypeModel" HeaderText="规格型号" />
                <asp:BoundField DataField="GoodsUnit" HeaderText="单位" />
                <asp:BoundField DataField="OrderCount" HeaderText="采购数量" /> 
                <asp:TemplateField HeaderText="入库数量">
                    <ItemTemplate>
                        <asp:HiddenField ID ="GoodsID" runat="server" Value='<%#Eval("GoodsID") %>' />
                        <asp:TextBox ID="GoodsCount" runat="server" CssClass="smallInput" Width="80" value='<%#DataBinder.Eval(Container.DataItem,"GoodsCount")%>' name="GoodsCount" type="text" ></asp:TextBox> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="单价">
                    <ItemTemplate>
                        <asp:TextBox ID="StandardCost" runat="server" CssClass="smallInput" Width="80" value='<%#DataBinder.Eval(Container.DataItem,"StandardCost")%>' name="StandardCost" type="text" ></asp:TextBox> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="CountCost" HeaderText="金额" />
                <asp:TemplateField HeaderText="备注">
                    <ItemTemplate>
                        <asp:TextBox ID="Description" runat="server" CssClass="smallInput" Width="100" value='<%#DataBinder.Eval(Container.DataItem,"Description")%>' name="Description" type="text" ></asp:TextBox> 
                    </ItemTemplate> 
                </asp:TemplateField>
                <asp:BoundField DataField="IsCheck" HeaderText="状态" />
                <asp:CommandField ShowEditButton="true" EditText="确认"/>
                <asp:CommandField ShowDeleteButton="true" DeleteText="删除"/>
            </Columns>
        </ofcc:GridView>
    </div>     
</div> 
     <uc1:GoodItemSelect ID="GoodItemSelect" runat="server" />  
     <div class="webPanelButtonArea">
        <ofcc:LinkButton ID="btnSelect" runat="server" OnClick="btnSelect_Click" CssClass="linkButton" ValidationGroup="select">选择</ofcc:LinkButton> 
        <ofcc:LinkButton ID="btnSubmit" runat="server" ConfirmMessage="采购完成后将不能被删除或修改操作，确定采购完成？" OnClick="btnSubmit_Click" CssClass="linkButton" ValidationGroup="submit">采购完成</ofcc:LinkButton>
        <ofcc:LinkButton ID="btnCancel" runat="server" OnClick="btnCancel_Click"  CssClass="linkButton">取消</ofcc:LinkButton>
    </div>
    <asp:HiddenField ID="hfAddOrEdit" runat="server" />
    <asp:HiddenField ID="hfStockInID" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="P_StockInDate"
    Display="None" ErrorMessage="请选择入库日期" ValidationGroup="submit"></asp:RequiredFieldValidator>  
</asp:Panel> 
 
 <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup" Width="800px">
    <asp:Panel ID="Panel2" runat="server" CssClass="modalPopupHeader">
        <div>&nbsp;&nbsp;&nbsp;<asp:Literal ID="literalModalPopup" runat="server" Text="根据采购单入库"></asp:Literal></div>
    </asp:Panel>
 <div style="padding:2px; height:450px;"> 
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        <ContentTemplate>
        <asp:Panel ID="pnlPurchaseStockIn" runat="server">
           <div class="searchDiv" > 
               <table cellspacing="0" class="searchTable" style="margin-top:10px; margin-left:10px;">
                <tr>
                    <td>
                    采购单编号：
                    </td>
                    <td><asp:TextBox ID="S_PurchaseOrderCode" runat="server" CssClass="smallInput" MaxLength="64" ></asp:TextBox>
                    </td>
                    <td>
                    采购日期：
                    </td>
                    <td><asp:TextBox ID="S_PurchaseDate" runat="server" onfocus="calendar.ShowCaltable(this, event);" CssClass="smallInput" MaxLength="64" ></asp:TextBox>
                    </td>
                    <td>
                    采购类型：
                    </td>
                    <td>
                    <div class="select"><div><ofcc:DropDownList ID="S_PurchaseType" runat="server"></ofcc:DropDownList></div></div>
                    </td>
                    <td>
                        &nbsp;&nbsp;<asp:Button ID="Button1" runat="server" OnClick="btnPurchaseSearch_Click" Text=" 查询 "  CssClass="searchButton" /> 
                    </td>
                </tr>
                </table> 
           </div> 
        <ofcc:GridView ID="purchaseGridView" runat="server" AutoGenerateColumns="False" 
            onsplitpageindexchange="purchaseGridView_SplitPageIndexChange">
            <Columns>
                <asp:TemplateField HeaderText="选择">
                    <ItemTemplate>
                        <input id="PurchaseOrderID" name="PurchaseOrderID" type="radio" 
                            value='<%#DataBinder.Eval(Container.DataItem,"PurchaseOrderID")%>' />
                    </ItemTemplate>
                    <HeaderStyle Width="40px" />
                </asp:TemplateField>
                <asp:BoundField DataField="PurchaseOrderCode" HeaderText="采购单编号" />
                <asp:BoundField DataField="PurchaseDate" HeaderText="采购日期" />
                <asp:BoundField DataField="PurchaseTypeName" HeaderText="采购类型" />
                <asp:BoundField DataField="SupplierID" HeaderText="供应商" />
                <asp:BoundField DataField="UserName" HeaderText="经办人" />
                <asp:BoundField DataField="OrgName" HeaderText="经办部门" /> 
            </Columns>
        </ofcc:GridView>  
        </asp:Panel>
        </ContentTemplate>
        </asp:UpdatePanel>    
   </div>
        <div class="modalPopupFooter">
             <asp:LinkButton ID="btnModalPopupOK" runat="server" OnClientClick="_modalPopupHide()" onclick="btnModalPopupOK_Click" >确定</asp:LinkButton>
             <asp:LinkButton ID="btnModalPopupCancel" runat="server"  onclick="btnCancel_Click">取消</asp:LinkButton>
             <p style="display:none"><ofcc:LinkButton ID="btnModalPopupNone"  runat="server" >None Event</ofcc:LinkButton></p>
        </div>

<asp:HiddenField ID="hfModalPopup" runat="server" />
<ajax:ModalPopupExtender runat="server" ID="modalPopup"    
    PopupControlID="Panel1" 
    PopupDragHandleControlID="Panel2"
    TargetControlID="btnModalPopupNone"
    BackgroundCssClass="modalBackground"
    BehaviorID="modalPopupBehavior2" 
    DropShadow="True"
    >    
</ajax:ModalPopupExtender>
<script type="text/javascript">
    function _modalPopupHide(ev) {
        //fix firefox        
        $get('<%=Panel1.ClientID.ToString() %>').style.display = "none";
        if($get('<%=Panel1.ClientID.ToString() %>_DropShadow')!= null)
            $get('<%=Panel1.ClientID.ToString() %>_DropShadow').style.display = "none";
        var divList = $$('div.modalBackground');
        divList[0].style.display = "none";
        if(ev)
            ev.preventDefault();        
        var modalPopupBehavior2 = $find('modalPopupBehavior2');
        modalPopupBehavior2.hide();
    }
</script>
</asp:Panel>


<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableViewState="False"
    ShowMessageBox="True" ShowSummary="False" ValidationGroup="submit" />